<?php

/**
 * @Author: Wang Chunsheng 2192138785@qq.com
 * @Date:   2020-03-03 23:04:41
 * @Last Modified by:   Wang Chunsheng 2192138785@qq.com
 * @Last Modified time: 2020-04-09 15:22:22
 */

use common\models\DdGoods;
use yii\helpers\Html;
use common\widgets\MyActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\DdGoods */
/* @var $form yii\widgets\MyActiveForm */
?>

<div class="dd-goods-form">

    <div class="box-body table-responsive" style="padding:0px;">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th style='width:50px;'></th>
                    <th>属性名称</th>
                    <th>属性值</th>
                </tr>
            </thead>
            <tbody id="param-items">
                <?php foreach ($params as $key => $p) : ?>

                    <tr>
                        <td>
                            <a href="javascript:;" class="fa fa-move" title="拖动调整此显示顺序"><i class="fa fa-arrows"></i></a>&nbsp;
                            <a href="javascript:;" onclick="deleteParam(this)" style="margin-top:10px;" title="删除"><i class='fa fa-remove'></i></a>
                        </td>
                        <td>
                            <input name="param[param_title][<?= $p['id'] ?>]" type="text" class="form-control param_title" value="<?= $p['title'] ?>" />
                            <input name="param[param_id][<?= $p['id'] ?>]" type="hidden" class="form-control" value="<?= $p['id'] ?>" />
                        </td>
                        <td><input name="param[param_value][<?= $p['id'] ?>]" type="text" class="form-control param_value" value="<?= $p['value'] ?>" /></td>
                    </tr>

                <?php endforeach; ?>
            </tbody>
            <tbody>
                <tr>
                    <td colspan="3">
                        <a href="javascript:;" id='add-param' style="margin-top:10px;" title="添加属性">添加属性 <i class='fa fa-plus'></i></a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>